package dao

import (
	"gorm.io/gorm"
	"time"
)

type Ticket struct {
	gorm.Model
	MoverTheater string    `json:"moverTheater" gorm:"type:varchar(50);comment:'电影院名称'"`
	MovieName    string    `json:"movieName" gorm:"type:varchar(30);not null;comment:'电影名称'"`
	MoveType     int       `json:"moveType" gorm:"type:tinyint(1);comment:'1-搞笑,2-悬疑'"`
	MoveLanguage int       `json:"moveLanguage" gorm:"type:tinyint(1);comment:'1-国语2-英语'"`
	Date         string    `json:"date" gorm:"type:varchar(50);comment:'日期'"`
	BeginTime    time.Time `json:"beginTime" gorm:"type:datetime;comment:'电影开始时间'"`
	EndTime      time.Time `json:"endTime" gorm:"type:datetime;comment:'散场时间'"`
	MovieHouse   int       `json:"movieHouse" gorm:"type:int(2);comment:'影厅'"`
	SetNum       int       `json:"setNum" gorm:"type:int(4);comment:'座位数'"`
	TicketPrice  float64   `json:"ticketPrice" gorm:"type:decimal(10,2);comment:'票价'"`
}

func (Ticket) TableName() string {
	return "ticket"
}

type TicketSeat struct {
	gorm.Model
	TicketId int `json:"ticketId" gorm:"common:'电影票编号'"`
	Seat     int `json:"seat" gorm:"common:'座位'"`
	UserId   int `json:"userId" gorm:"common:'用户编号'"`
}

func (TicketSeat) TableName() string {
	return "ticket_seat"
}
